var mongoose = require('mongoose');

var userSchema = new mongoose.Schema({
  "userId": String,
  "userName": String,
  "messages": [
    {
      "caseId": String,
      "caseName": String,
      "detail": String,
      "time": {type: Date, default: Date.now()},
      "isRead": Boolean
    }
  ]
});

module.exports = mongoose.model("user", userSchema);
